This invention relates to the serializations of access to shared resources among concurrent processes in a multiprocess, multiprogramming CPU environment, and more particularly, to serialization by use of low-level atomic functions requiring an access initiation operation partitionable from an access completion operation.
As is known, a central electronic complex (CEC) can include one or more CPU's that utilize a main storage facility, input/output facilities and services, and communications facilities for communicating with, for example, another CEC.
In a CEC, or in a CPU of a CEC, concurrently-operating processes can compete for access to shared resources such as memory, I/O, a CPU, data lists, or communications services, which are necessary to assist a process in its operation.
When used herein, the term process refers to a sequence of operations that result in an identifiable outcome. A number of processes can operate concurrently in a CEC in either a multiprocessing or a multiprogramming environment.
Customarily, an operating system is provided in a CEC, which consists of software that controls execution of programs. An operating system is typically enabled to schedule events, control the execution of processes and schedule their access to resources. In this regard, an operating system facilitates orderly access to resources by implementing sequencing mechanisms that serialize the access of competing processes to shared resources.
As described in Hwang and Briggs, "Computer Architecture and Parallel Processing," 1984, one method of resource use serialization of competing processes involves a synchronization mechanism that utilizes a shared variable whose condition indicates the status of a shared resource. Access of a process to the resource is signalled by the variable being placed by the process into a "busy" condition, which indicates unavailability of the resource to other processes requiring use of it. When a process observes that the shared variable has an "available" or "unbusy" condition, it will be able to obtain the resource for its own use.
Mutual exclusion of access to shared resources, according to Hwang and Briggs, can be implemented by a sequence of instructions forming a part of an operating system that define "lock" and "unlock" operations. For the lock operation, a process executes against a resource status variable (RSV) by inspecting its current condition and, when the condition is other than busy (unlocked), setting the RSV to busy (locking it), and then using the resource. Then, when use of the resource is completed, the process executes against the RSV in an unlock operation wherein the RSV is set to a nonbusy condition. Under this construct, a process has exclusive control over the resource once it "locks" the lock; other processes cannot gain entree until the controlling process "unlocks" the lock.
To preclude the ambiguous circumstance where one process detects a nonbusy condition before a competing process sets the RSV to "busy," the IBM System/370 extended architecture (as described in IBM Publication No. SA 22-7085-0) provides a family of atomic operations that test and modify an RSV held at a storage location in a single read-modify-write instruction cycle. The atomic operations are completed in one cycle so that the RSV is not tested and set by another process before the currently-executing process completes its operation. Thus, the operations are "atomic" in the sense that they either succeed completely in altering the condition of the RSV or fail, in which case the RSV is left unchanged.
Obermarck U.S. Pat. No. 4,399,504 teaches lock management to control access to data resources shared by two or more central electronic complexes. Obermarck is instructive in one of the principal limitations of presently-utilized lock operations: the requirement that waiting processes suspend operations when contending for shared resources.
Methods other than lock setting are also available to serialize access to shared resources. Roever U.S. Pat. No. 4,189,771 describes a single thread, contention-free process for detecting deadlock from a vector of process wait relations. Carlson et al. U.S. Pat. No. 4,410,940 provides for transfer of control among hierarchically related processes through the use of pointers to traverse an activity. Chatfield U.S. Pat. No. 4,183,083 utilizes a form of dynamic scheduling to increase throughput in a multiprogrammed computing system.
Processor synchronization, implemented by interprocess communication, is also used to serialize utilization of shared resources. Interprocess communication involves passing data across message interfaces between processes. This is typically referred to as "loose coupling." Loose coupling by processor intercommunication places reliance on pattern and content of message traffic. Moreover, it is often the case that communicating processors may share only a few physical resources such as the network or secondary storage. Securing mutual exclusion of resource access while avoiding mutual blocking or suspension has led to embedding language/algorithmic constructs within the competing processes or embedding such constructs in the form of monitors in operating systems. A well-known software solution in this regard has been contributed by Dijkstra in "Cooperating Sequential Processes," PROGRAMMING LANGUAGES, Academic Press, 1968. However, such constructs are too slow to provide nanosecond access in tightly-coupled environments where, for example, two processes compete for main store.